home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 2
/
LIGHT-ROM 2 (Amiga Library Services)(1995).iso
/
als
/
amigalib.mk
next >
Wrap
Makefile
|
1995-03-23
|
4KB
|
129 lines
# Amiga Library Services - CD Administration Makefile
#
# This Makefile is envoked from the root directory of the CD-ROM
# master file tree and is responsible for doing such things as:
#
# * Building the automatically generated files for the release.
#
# * "Cleaning up" the file tree.
# These things will probably need to be changed with each CD release
# or whenever the host system changes configuration.
CDNAME = LR
VOLNAME = $(CDNAME)
IMAGE = ISO2:$(VOLNAME).iso
# These things will probably remain constant across CD releases.
PUBLISHER = "Amiga Library Services - (602) 491-0048"
PREPARER = "Fred Fish"
MAKE = make
SHELL = /bin/sh
# The default thing to do is nothing, except to suggest things that
# can be done.
all:
@echo "rerun make with one of:"
@echo " [iso, rebuild, FILELIST, CRCLIST]"
# This target will rebuild all the machine generated files, after doing
# a "make clobber".
rebuild: ALS/DIRLIST ALS/FILELIST ALS/CRCLIST
# -a Include all files
# -A Map filenames to ISO compliant file names.
# -c Do not convert filenames
# -e Sort file extents by common extensions.
# -r Inhibit relocation of directories.
# -R Enable RockRidge extensions.
# -T Generate a file TRANS.TBL to make ISO names to original names.
iso: ALS/CRCLIST
mkisofs -a -c -e -r -o $(IMAGE) -P $(PUBLISHER) -p $(PREPARER) \
-V $(VOLNAME) $(VOLNAME):
# Build the DIRLIST, FILELIST and CRCLIST files. Note that we ensure
# that a FILELIST and CRCLIST file exist by touching them before building
# the updated FILELIST, and then removing the CRCLIST file (even a
# previously existing one) after building the new FILELIST, since the
# CRCLIST needs to be rebuilt anyway if the FILELIST is touched. However
# since we can't compute a CRC for the CRC file itself without major
# trickery, the CRCLIST is generated using a copy of FILELIST that has
# had the CRCLIST line removed. All these gyrations ensure that the
# FILELIST file includes entries for both itself and the CRCLIST file,
# while the CRCLIST file contains no entry for itself.
#
# Also note that the output is stored in a temporary file on a different
# volume, so as to avoid problems on the Amiga with "find" trying to
# lock CRCLIST while it is open for write.
ALS/DIRLIST:
find . -type d -print | sort | sed -e "s:^./::" -e "/^\.$$/d" >/tmp/DIRLIST
cp /tmp/DIRLIST $@
rm -f /tmp/DIRLIST
ALS/FILELIST: ALS/DIRLIST
touch $@ ALS/CRCLIST
find . -type f -print | sort | sed "s:^./::" >/tmp/FILELIST
cp /tmp/FILELIST $@
rm -f /tmp/FILELIST ALS/CRCLIST
ALS/CRCLIST: ALS/FILELIST
sed "/^ALS\/CRCLIST$$/d" <ALS/FILELIST >/tmp/FILELIST
brik -Gvbf /tmp/FILELIST >$@
# Clean out the machine generated files in preparation for rebuilding them.
clobber: clean
rm -f ALS/DIRLIST ALS/FILELIST ALS/CRCLIST
clean:
rm -f *! *~
# Update all hardwired device names in LoadObject commands prior to releasing
# a new version of this CD for which the volume name changes. Note that we
# restrict ourselves to LoadObject commands that start a line, which helps us
# to avoid changing *this* file as well!
fix: ALS/FILELIST
-cat ALS/FILELIST | xargs grep -li "^[ \t]*LoadObject[ \t]*.*:" >/tmp/LoadObject.list
for i in `cat /tmp/LoadObject.list`; do \
echo -n "Checking $$i ... "; \
sed "s@LoadObject[ \t]*.*:@LoadObject $(CDNAME):@" <$$i >/tmp/tmpfile; \
if cmp $$i /tmp/tmpfile >/dev/null; then \
echo "not changed."; \
else \
mv $$i $$i.orig; \
cp /tmp/tmpfile $$i; \
echo "fixed."; \
fi; \
done
cat /tmp/LoadObject.list | xargs grep -i LoadObject | grep -v $(CDNAME)
rm -f /tmp/LoadObject.list
# Examine the FILELIST and gripe about any names that are not strictly
# MS-DOS conformant (8.3, uppercase alphanumeric, etc).
dosnames: ALS/FILELIST
-doschk <ALS/FILELIST
-grep "[^A-Z_0-9./]" <ALS/FILELIST >/tmp/badchars
-if test -s /tmp/badchars ; then \
echo; \
echo "WARNING - The following pathnames contain illegal MS-DOS characters:"; \
cat /tmp/badchars; \
fi
rm -f /tmp/badchars
-grep "[A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9][A-Z_0-9]" <ALS/FILELIST >/tmp/TooLong
-if test -s /tmp/TooLong ; then \
echo; \
echo "WARNING - The following pathnames contain prefixes or suffixes over 8 characters long:"; \
cat /tmp/TooLong; \
fi
rm -f /tmp/TooLong